<?php
class Info_remindAction extends IntesysAction {
	function _initialize(){
		parent::_initialize();
		$this->dao=D('Info');	
	}
	function index(){
		//筛选结果并显示
		//$this->initView();
		//$this->dao->filter('remind',$this->view);
       //获取 筛选或添加 部门，所有员工等数据
       //$membergroup=M('member_group')->getGroup();
       //$this->assign('grouplist',$membergroup);
       //$staff=D('Member')->getallgroupmember();
       //$this->assign('memberlist',$staff);
	   $this->listmap="tomemberid=".$this->UserInfo." and type='remind'";
	   $this->listCount=$this->dao->where($this->listmap)->count();
	   $this->listorder='id desc';
	   $this->pagesize=16;
	   parent::_list();
       $this->display();
	}
	public function update(){
		if($this->_get('id')){
            $_POST['id']=$this->_get('id');
            if(isset($_POST['content'])){
                //$_POST['content']=str_replace(array("\r\n","\n","\r"),'<br/>',strip_tags($_POST['content']));
            }
			parent::update();
		}
	}
	public function insert(){
        if(IS_POST){
            $_POST['site_id'] =__SITEID__;
            if($_POST['type']!=0||!isset($_POST['type']))$_POST['type']='remind';
            $_POST['datetime']=time();
            $_POST['member_id']=session(C('USER_AUTH_KEY'));
            //$_POST['content']=str_replace(array("\r\n","\n","\r"),'<br/>',strip_tags($_POST['content']));
            parent::insert();
        }
	}
	public function delete(){
		if($this->_get('id')){
			parent::delete();
		}
	}
	public function remindList(){
		$this->list=$this->dao->where("tomemberid=".$this->UserInfo." and type='remind' and click=0")->order('id desc')->limit(5)->select();
		$this->listCount=$this->dao->where("tomemberid=".$this->UserInfo." and type='remind' and click=0")->count();
		$this->display();
	}
}

